Repository navigation
Rules findings never stall a run: new items judged by structure, and a wait on a person always names what for - #488
Merged
Conversation
…a wait on a person always names what for The registration rule counted any new file in a folder as a sibling that must be registered, so a validation helper beside schema documents blocked the pull request. A new file is now an item of its siblings' kind only when its export shape matches theirs and the registries' imports; when that can't be told, its places are only noted. A run that stopped after its work was set to needs_input with nothing asked and sat silently. Every needs_input write now carries a named wait (its questions, or an action such as reviewing its pull request), shown on the run page and in the run.needs_input event. The stuck-run sweep names any wait that names nothing, alarms on it, and sends one reminder after 24 hours.
nambok
force-pushed
the
fix/rules-sibling-structure
branch
from
November 6, 2026 14:47
f447b82 to
090f240
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A run did all its tasks, passed the code generator and the security audit, and was then blocked by the new-feature rules: a new
<name>-validation.tsmodule (validation predicates only, no schema) next to the schema documents was treated as an unregistered document. The run opened a draft PR with that as its open item and was set toneeds_inputwith no question. Nothing asked anyone anything, and it waited three days while its PR only needed a review.This fixes both halves:
defineType(...), base class, trait, decorator) and the shape the registries import them by (a registry that imports each sibling's default export needs one from the new file). Helpers, validators, utilities, types and generated files beside them are not items. When the structure can't tell, the places are noted for a person, never a block.needs_inputwrite now carrieswaiting_on: the questions to answer, or one named action (review pull request #n with what is open, answer an approval, add the missing detail to the ticket). The only way to write the status isrun_wait::NeedsInput::needs_input, and a test reads the worker and gateway sources so no write sets it any other way. A run stopped after its work now waits for its PR's review by name.needs_inputruns: one that names nothing is reported (run_waiting_unasked, metric + alarm), given a named wait (its PR's review, else a Retry with its reason), and notified. A run still waitingREMIND_AFTER_HOURS(24) after its wait started gets one reminder through the usualrun.needs_inputevent.Rules findings were already Open items rather than stops since #485 (
feature::gate's error becomesproof::blocked_itemand the run continues toawaiting_ci); this keeps that and closes the remainingneeds_input-with-nothing paths (stop_pr, run guard, own-review stop, planned-work stop, approval timeout, ceiling, reopen).Changes
worker/passes/feature/registration.rs:Shape,shape,imports_default,kind_of(Same / Other / Unknown),judge; types and generated files are never items; Unknown turns places into notes.common/src/run_wait.rs(new):WaitingOn,asks_something,reminder_due,REMIND_AFTER_HOURS, theNeedsInputwrite, and the source test.needs_inputwrite (passes/mod.rs,stop_pr.rs,run_guard.rs,resume.rsviawait_for_review,agent/policy.rs,gateway/routes/run_close.rsreopen) names its wait.gateway/routes/api.rs:waiting_onon the run (OpenAPI regenerated).webhooks.rs: therun.needs_inputevent'serrorsays what the run waits for.run_waitingworker message (contract, DLQ list): the sweep's reminder and named-wait notice, sent asrun.needs_input.lambda/stuck-run-cleanup: readsneeds_inputruns, names empty waits, reminds once; the over-ceiling stop names its wait. Infra:TICKET_QUEUE_URL+ send grant for the sweep,RunWaitingUnaskedmetric and alarm.Verification
cargo fmt --all --check,cargo clippy -p worker -p common -p gateway --all-targets -D warnings: clean.cargo test -p worker -p common -p gateway: all pass (worker 1444, common 735, gateway 1297).python3 -m unittest discover -s lambda/tests: 360 pass.needs_inputcan't be written without a wait (source test) and a wait is never blank; the sweep finds a stalled run with a PR, hands it to review and notifies; one reminder per wait; the sweep's message matches the worker contract.